package tom.client.invoice;

import java.util.List;

import tom.shared.ContDept;
import tom.shared.Contact;
import tom.shared.ContactGroup;
import tom.shared.Customer;
import tom.shared.InvItem;
import tom.shared.Invoice;
import tom.shared.Payment;
import tom.shared.Paymeth;
import tom.shared.RReason;
import tom.shared.Supplier;

import com.google.gwt.user.client.rpc.RemoteService;

public interface Service extends RemoteService {
	Integer find(String docuKind, String docRef);
	
	List<Payment> selectPayment(Integer invNo);

	Payment selectPayment(String payNo);

	boolean insertPayment(Payment record);

	boolean insertPayment(Invoice inv);

	boolean updatePayment(Payment record);

	boolean deletePayment(String payNo);

	Contact selectContact(String contCode);

	boolean insertContact(Contact record);

	boolean updateContact(Contact record);

	boolean deleteContact(String contCode);

	List<ContactGroup> selectContGroup(String contCode);

	boolean insertContGroup(String contCode, Integer grpId);

	boolean deleteContGroup(String contCode, Integer grpId);

	ContactGroup selectContGroup(Integer grpId);

	boolean insertContGroup(ContactGroup record);

	boolean deleteContGroup(Integer grpId);

	boolean updateContGroup(ContactGroup record);

	Customer selectCustomer(String contCode);

	boolean insertDebter(Customer record);

	boolean updateCustomer(Customer record);

	boolean deleteDebter(String contCode);

	String insertInvoice(Invoice inv);

	String updateInvoice(Invoice inv);

	List<Invoice> searchInvoice(String invCode, String invDate,
			String docuKind, String systemKind, String totalAmt,
			Boolean balanceDue, String address, String contCode, String status);

	Invoice selectInvoice(Integer invNo);

	List<InvItem> selectInvItem(Integer invNo);

	boolean deleteInvoice(Integer invNo);

	List<String[]> selectPaymeth();

	List<ContDept> selectContDept(String contCode);

	boolean insertContDept(ContDept record);

	boolean updateContDept(ContDept record);

	boolean deleteContDept(String contCode);

	List<Paymeth> selectPaymeth(String payCode);

	boolean insertPaymeth(Paymeth record);

	boolean updatePaymeth(Paymeth record);

	boolean deletePaymeth(Paymeth contCode);

	String refundInvoice(Invoice record);

	RReason isStockUpdate(String resCode);

	List<ContDept> selectAddrDept(String contCode);

	boolean saveAddrDept(List<ContDept> list);

	boolean updateSupplier(Supplier record);

	Supplier selectSupplier(String contCode);
	
	boolean rollbackInvoice(Integer invNo);
}
